WOLF core
WOLF: A Modular Estimation Framework for Robotics
XXXXXXXXXXXXXXXXXXXXXXXXvoid(0)" frameborder="0" name="MSearchResults" id="MSearchResults">
wolf::SolverEigen Class Reference

Gauss-Newton solver using sparse linear solvers through Eigen (no ceres dependency) More...

#include <core/solver/solver_eigen.h>

Inheritance diagram for wolf::SolverEigen:
[legend]

Classes

struct  SuiteSparseSolvers
 

Public Types

enum class  LinearSolverType { QR , CHOLESKY }
 Linear solver type. More...
 
- Public Types inherited from wolf::SolverManager
enum class  CovarianceBlocksToBeComputed : std::size_t {
  ALL = 0 , ALL_MARGINALS = 1 , ROBOT_LANDMARKS = 2 , GAUSS = 3 ,
  GAUSS_TUCAN = 4 , GAUSS_TUCAN_ONLY_POSITION = 5
}
 Enumeration of covariance blocks to be computed. More...
 
enum class  ReportVerbosity : std::size_t { QUIET = 0 , BRIEF = 1 , FULL = 2 }
 Enumeration for the verbosity of the solver report. More...
 

Public Member Functions

 SolverEigen (const ProblemPtr &_wolf_problem, const YAML::Node &_params)
 Constructor from the problem and the YAML parameters. More...
 
 WOLF_SOLVER_CREATE (SolverEigen)
 
 ~SolverEigen () override
 
bool computeCovariancesDerived (const CovarianceBlocksToBeComputed _blocks) override
 Computes the covariances of the specified blocks in the derived solver. More...
 
bool computeCovariancesDerived (const std::vector< StateBlockPtr > &st_list) override
 Computes the covariances of a list of state blocks in the derived solver. More...
 
bool converged () const override
 Returns whether the last solve converged. More...
 
bool failed () const override
 Returns whether the last solve failed. More...
 
bool wasStopped () const override
 Returns whether the last solve was stopped (interrupted by a problem change) More...
 
unsigned int iterations () const override
 Returns the number of iterations of the last solve. More...
 
double initialCost () const override
 Returns the initial cost of the last solve. More...
 
double finalCost () const override
 Returns the final cost of the last solve. More...
 
double totalTime () const override
 Returns the total time of the last solve. More...
 
int numStateBlocksEstimatedDerived () const override
 Returns the number of estimated state blocks in the derived solver. More...
 
int sizeStateBlocksEstimatedDerived () const override
 Returns the total size of the estimated state blocks in the derived solver. More...
 
int numFactorsDerived () const override
 Returns the number of factors in the derived solver. More...
 
int sizeFactorsDerived () const override
 Returns the total residual size of the factors in the derived solver. More...
 
LinearSolverType getLinearSolverType () const
 Returns the linear solver type. More...
 
std::string getLinearSolverName () const
 Linear solver and its implementation, e.g. "cholesky (CHOLMOD)" or "qr (Eigen SparseQR)". More...
 
const Eigen::SparseMatrix< double > & getJacobian () const
 Stacked jacobian of the last linearization (with loss function weights) More...
 
std::string terminationType () const
 
std::string briefReport () const
 One line report of the last solve (as ceres::Solver::Summary::BriefReport()) More...
 
std::string fullReport () const
 Full report of the last solve (as ceres::Solver::Summary::FullReport()) More...
 
- Public Member Functions inherited from wolf::SolverManager
void printProfiling (std::ostream &stream=std::cout) const
 Prints the profiling of the solver manager (and of the derived solver) More...
 
const ProfilingUnit & getProfilingTotal () const
 Returns the profiling of solve(): update problem, solve and update state. More...
 
const ProfilingUnit & getProfilingSolve () const
 Returns the profiling of the solving. More...
 
const ProfilingUnit & getProfilingUpdate () const
 Returns the profiling of the problem update. More...
 
const ProfilingUnit & getProfilingState () const
 Returns the profiling of the state update. More...
 
const ProfilingUnit & getProfilingCov () const
 Returns the profiling of the covariances computation. More...
 
 SolverManager (const ProblemPtr &_problem)
 Constructor with default params_. More...
 
 SolverManager (const ProblemPtr &_problem, const YAML::Node &_params)
 Constructor with given params_. More...
 
virtual ~SolverManager ()
 Destructor. More...
 
std::string solve ()
 Solves with the verbosity defined in params_. More...
 
std::string solve (const ReportVerbosity report_level)
 Solves with a given verbosity. More...
 
virtual bool computeCovariances () final
 Computes the covariances of the blocks specified in the parameters. Returns whether it succeeded. More...
 
virtual bool computeCovariances (const CovarianceBlocksToBeComputed blocks) final
 Computes the covariances of the specified blocks. Returns whether it succeeded. More...
 
virtual bool computeCovariances (const std::vector< StateBlockPtr > &st_list) final
 Computes the covariances (and cross-covariances) of a list of state blocks. Returns whether it succeeded. More...
 
virtual void update ()
 Updates solver's problem according to the wolf_problem. More...
 
ProblemPtr getProblem ()
 Returns the wolf problem. More...
 
YAML::Node getParams () const
 Returns a copy of the YAML parameters. More...
 
bool getComputeCov () const
 Returns whether the covariances are computed in the solver loop. More...
 
double getPeriod () const
 Returns the period of the solver loop. More...
 
double getCovPeriod () const
 Returns the period of the covariances computation in the solver loop. More...
 
ReportVerbosity getVerbosity () const
 Returns the verbosity of the solver report. More...
 
virtual bool isStateBlockRegistered (const StateBlockPtr &state_ptr) const final
 Returns whether a state block is registered in the solver. More...
 
virtual bool isStateBlockFloating (const StateBlockPtr &state_ptr) const final
 Returns whether a state block is floating: not involved in any factor, so kept out of the solver. More...
 
virtual bool isStateBlockFixed (const StateBlockPtr &st) const final
 Returns whether a registered state block is fixed in the solver. More...
 
virtual bool isFactorRegistered (const FactorBasePtr &fac_ptr) const final
 Returns whether a factor is registered in the solver. More...
 
virtual bool hasThisLocalParametrization (const StateBlockPtr &st, const LocalParametrizationBasePtr &local_param) const final
 Returns whether a state block has a given local parametrization in the solver. More...
 
virtual bool hasLocalParametrization (const StateBlockPtr &st) const final
 Returns whether a state block has a local parametrization in the solver. More...
 
virtual int numFactors () const final
 Returns the number of registered factors. More...
 
virtual int sizeFactors () const final
 Returns the total residual size of the registered factors. More...
 
virtual int numStateBlocks () const final
 Returns the number of state blocks (registered and floating) More...
 
virtual int sizeStateBlocks () const final
 Returns the total size of the state blocks (registered and floating) More...
 
virtual int numStateBlocksEstimated () const final
 Returns the number of estimated state blocks: registered and not fixed. More...
 
virtual int sizeStateBlocksEstimated () const final
 Returns the total size of the estimated state blocks: registered and not fixed. More...
 
virtual int numFactorsDerived () const =0
 Returns the number of factors in the derived solver. More...
 
virtual int sizeFactorsDerived () const =0
 Returns the total residual size of the factors in the derived solver. More...
 
virtual int numStateBlocksEstimatedDerived () const =0
 Returns the number of estimated state blocks in the derived solver. More...
 
virtual int sizeStateBlocksEstimatedDerived () const =0
 Returns the total size of the estimated state blocks in the derived solver. More...
 
virtual bool check (std::string prefix="") const final
 Checks the consistency of the solver manager and of the derived solver. More...
 
virtual bool converged () const =0
 Returns whether the last solve converged. More...
 
virtual bool failed () const =0
 Returns whether the last solve failed. More...
 
virtual bool wasStopped () const =0
 Returns whether the last solve was stopped (interrupted by a problem change) More...
 
virtual unsigned int iterations () const =0
 Returns the number of iterations of the last solve. More...
 
virtual double initialCost () const =0
 Returns the initial cost of the last solve. More...
 
virtual double finalCost () const =0
 Returns the final cost of the last solve. More...
 
virtual double totalTime () const =0
 Returns the total time of the last solve. More...
 
virtual void run () final
 Runs the solver loop in a separate thread. More...
 
virtual void stop () final
 Stops the solver loop and joins its thread. More...
 

Protected Member Functions

std::string solveDerived (const ReportVerbosity report_level) override
 Solves the problem in the derived solver, returning the report. More...
 
void addFactorDerived (const FactorBasePtr &fac_ptr) override
 Adds a factor to the derived solver. More...
 
void removeFactorDerived (const FactorBasePtr &fac_ptr) override
 Removes a factor from the derived solver. More...
 
void addStateBlockDerived (const StateBlockPtr &state_ptr) override
 Adds a state block to the derived solver. More...
 
void removeStateBlockDerived (const StateBlockPtr &state_ptr) override
 Removes a state block from the derived solver. More...
 
void updateStateBlockStatusDerived (const StateBlockPtr &state_ptr) override
 Updates the fixed/unfixed status of a state block in the derived solver. More...
 
void updateStateBlockLocalParametrizationDerived (const StateBlockPtr &state_ptr) override
 Updates the local parametrization of a state block in the derived solver. More...
 
bool isFactorRegisteredDerived (const FactorBasePtr &fac_ptr) const override
 Returns whether a factor is in the derived solver. More...
 
bool isStateBlockRegisteredDerived (const StateBlockPtr &state_ptr) const override
 Returns whether a state block is in the derived solver. More...
 
bool isStateBlockFixedDerived (const StateBlockPtr &st) const override
 Returns whether a state block is fixed in the derived solver. More...
 
bool hasThisLocalParametrizationDerived (const StateBlockPtr &st, const LocalParametrizationBasePtr &local_param) const override
 Returns whether a state block has a given local parametrization in the derived solver. More...
 
bool hasLocalParametrizationDerived (const StateBlockPtr &st) const override
 Returns whether a state block has a local parametrization in the derived solver. More...
 
void printProfilingDerived (std::ostream &_stream) const override
 Prints the profiling of the derived solver. More...
 
bool checkDerived (std::string prefix="") const override
 Checks the consistency of the derived solver. More...
 
void reindex ()
 Recomputes the column of each non-fixed state block and the row of each factor (if structure changed) More...
 
bool linearize (bool _apply_loss)
 
bool factorize ()
 Factorizes A_ with the selected linear solver. Returns false if it failed or A_ is rank deficient. More...
 
Eigen::VectorXd solveIncrement () const
 Solves A_·dx = -b_ using the last factorization. More...
 
Eigen::MatrixXd solveNormalEquations (const Eigen::MatrixXd &_E) const
 Solves (AᵀA)·X = E using the last factorization. More...
 
bool computeCovarianceBlocks (const std::vector< std::pair< StateBlockPtr, StateBlockPtr > > &_pairs)
 Computes and stores in the problem the covariance blocks of the given pairs of state blocks. More...
 
void applyIncrement (const Eigen::VectorXd &_dx)
 Applies an increment (in the tangent space) to the non-fixed state blocks. More...
 
- Protected Member Functions inherited from wolf::SolverManager
virtual Eigen::VectorXd & getAssociatedMemBlock (const StateBlockPtr &state_ptr)
 Returns the state vector of a registered state block used by the solver. More...
 
const double * getAssociatedMemBlockPtr (const StateBlockPtr &state_ptr) const
 Returns a pointer to the state vector of a registered state block used by the solver. More...
 
double * getAssociatedMemBlockPtr (const StateBlockPtr &state_ptr)
 Returns a pointer to the state vector of a registered state block used by the solver. More...
 
virtual std::string solveDerived (const ReportVerbosity report_level)=0
 Solves the problem in the derived solver, returning the report. More...
 
virtual bool computeCovariancesDerived (const CovarianceBlocksToBeComputed blocks)=0
 Computes the covariances of the specified blocks in the derived solver. More...
 
virtual bool computeCovariancesDerived (const std::vector< StateBlockPtr > &st_list)=0
 Computes the covariances of a list of state blocks in the derived solver. More...
 
virtual void addFactorDerived (const FactorBasePtr &fac_ptr)=0
 Adds a factor to the derived solver. More...
 
virtual void removeFactorDerived (const FactorBasePtr &fac_ptr)=0
 Removes a factor from the derived solver. More...
 
virtual void addStateBlockDerived (const StateBlockPtr &state_ptr)=0
 Adds a state block to the derived solver. More...
 
virtual void removeStateBlockDerived (const StateBlockPtr &state_ptr)=0
 Removes a state block from the derived solver. More...
 
virtual void updateStateBlockStatusDerived (const StateBlockPtr &state_ptr)=0
 Updates the fixed/unfixed status of a state block in the derived solver. More...
 
virtual void updateStateBlockLocalParametrizationDerived (const StateBlockPtr &state_ptr)=0
 Updates the local parametrization of a state block in the derived solver. More...
 
virtual bool isStateBlockRegisteredDerived (const StateBlockPtr &state_ptr) const =0
 Returns whether a state block is in the derived solver. More...
 
virtual bool isFactorRegisteredDerived (const FactorBasePtr &fac_ptr) const =0
 Returns whether a factor is in the derived solver. More...
 
virtual bool isStateBlockFixedDerived (const StateBlockPtr &st) const =0
 Returns whether a state block is fixed in the derived solver. More...
 
virtual bool hasLocalParametrizationDerived (const StateBlockPtr &st) const =0
 Returns whether a state block has a local parametrization in the derived solver. More...
 
virtual bool hasThisLocalParametrizationDerived (const StateBlockPtr &st, const LocalParametrizationBasePtr &local_param) const =0
 Returns whether a state block has a given local parametrization in the derived solver. More...
 
virtual void printProfilingDerived (std::ostream &stream=std::cout) const =0
 Prints the profiling of the derived solver. More...
 
virtual bool checkDerived (std::string prefix="") const =0
 Checks the consistency of the derived solver. More...
 

Protected Attributes

std::map< StateBlockPtr, unsigned int > sb_2_col_
 First column of each non-fixed state block. More...
 
std::map< FactorBasePtr, unsigned int > fac_2_row_
 First row of each factor. More...
 
std::map< StateBlockPtr, LocalParametrizationBasePtr > sb_2_local_param_
 Local param of each state block. More...
 
std::set< StateBlockPtr > fixed_state_blocks_
 Registered fixed state blocks. More...
 
bool structure_dirty_
 The structure changed: reindexing needed. More...
 
unsigned int n_rows_
 Rows of the stacked jacobian. More...
 
unsigned int n_cols_
 Columns of the stacked jacobian. More...
 
Eigen::SparseMatrix< double > A_
 Stacked jacobian (weighted by the loss function if applicable) More...
 
Eigen::VectorXd b_
 Stacked residuals (weighted by the loss function if applicable) More...
 
double cost_
 Cost at the current estimate. More...
 
LinearSolverType linear_solver_
 Linear solver type. More...
 
bool analysis_dirty_
 The structure changed: symbolic analysis of the factorization needed. More...
 
Eigen::SparseQR< Eigen::SparseMatrix< double >, Eigen::NaturalOrdering< int > > qr_
 Columns ordered in reindex() More...
 
Eigen::SimplicialLDLT< Eigen::SparseMatrix< double > > ldlt_
 Eigen's Cholesky (LDLT) of the normal equations. More...
 
std::unique_ptr< SuiteSparseSolvers > suitesparse_
 SPQR and CHOLMOD (defined only if SuiteSparse was found) More...
 
Eigen::SparseMatrix< double > R_
 (sorted) R factor of the QR, used for covariances More...
 
Eigen::SparseMatrix< double > Rt_
 Transpose of R_. More...
 
Eigen::PermutationMatrix< Eigen::Dynamic, Eigen::Dynamic, int > R_perm_
 Column permutation of the QR. More...
 
unsigned int max_num_iterations_
 Maximum number of iterations. More...
 
double function_tolerance_
 Convergence tolerance on the cost change. More...
 
double parameter_tolerance_
 Convergence tolerance on the step size. More...
 
double gradient_tolerance_
 Convergence tolerance on the gradient. More...
 
bool interrupt_on_problem_change_
 Interrupt the solver if the problem changed (as SolverCeres) More...
 
unsigned int min_num_iterations_
 Iterations during which the solver cannot be interrupted. More...
 
unsigned int iterations_
 Number of iterations. More...
 
double initial_cost_
 Cost before the solve. More...
 
double final_cost_
 Cost after the solve. More...
 
double total_time_
 Total time of the solve. More...
 
bool converged_
 Terminated by convergence. More...
 
bool failed_
 Terminated by failure. More...
 
bool stopped_
 Terminated by interruption. More...
 
std::string termination_message_
 Termination message. More...
 
unsigned int successful_steps_
 Accepted Gauss-Newton steps. More...
 
unsigned int unsuccessful_steps_
 Rejected Gauss-Newton steps. More...
 
unsigned int line_search_steps_
 Step halvings of the backtracking line search. More...
 
unsigned int n_linearizations_
 Number of linearizations. More...
 
unsigned int n_linear_solves_
 Number of linear solves. More...
 
double preprocessor_time_
 Time of the preprocessing stage. More...
 
double minimizer_time_
 Time of the minimization stage. More...
 
double postprocessor_time_
 Time of the postprocessing stage. More...
 
double linearization_time_
 Time spent linearizing. More...
 
double linear_solver_time_
 Time spent in linear solves. More...
 
unsigned int n_iter_acc_
 Accumulated iterations of all solves. More...
 
unsigned int n_iter_max_
 Maximum iterations of a single solve. More...
 
unsigned int n_convergence_
 Solves terminated by convergence. More...
 
unsigned int n_interrupted_
 Solves terminated by interruption. More...
 
unsigned int n_failed_
 Solves terminated by failure. More...
 
unsigned int n_no_convergence_
 Solves terminated without convergence. More...
 
- Protected Attributes inherited from wolf::SolverManager
ProblemPtr wolf_problem_
 Wolf problem. More...
 
ProfilingUnit profiling_total_
 Profiling units of solve(), solving, problem update, state update and covariances computation. More...
 
ProfilingUnit profiling_solve_
 Solving. More...
 
ProfilingUnit profiling_update_
 Problem update. More...
 
ProfilingUnit profiling_state_
 State update. More...
 
ProfilingUnit profiling_cov_
 Covariances computation. More...
 
YAML::Node params_
 YAML parameters. More...
 
std::map< StateBlockPtr, Eigen::VectorXd > state_blocks_
 Registered state blocks and solver states. More...
 
std::map< StateBlockPtr, FactorBasePtrList > state_blocks_2_factors_
 Factors of each registered state block. More...
 
std::set< FactorBasePtr > factors_
 Registered factors. More...
 
std::set< StateBlockPtr > floating_state_blocks_
 State blocks not involved in any factor. More...
 
double period_
 Period of the solver loop. More...
 
ReportVerbosity verbose_
 Verbosity of the solver report. More...
 
bool compute_cov_
 Whether the covariances are computed in the solver loop. More...
 
CovarianceBlocksToBeComputed cov_enum_
 Covariance blocks computed in the solver loop. More...
 
double cov_period_
 Period of the covariances computation in the solver loop. More...
 
std::chrono::high_resolution_clock::time_point last_cov_time_
 Time of the last covariances computation. More...
 
bool stopping_
 Whether the solver loop has to stop. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from wolf::SolverManager
static SolverManagerPtr autoSetup (const ProblemPtr &_problem, const std::string &_input_yaml_file, std::vector< std::string > _primary_schema_folders, bool _skip_yaml_validation=false)
 Creates a solver from a YAML file (see the YAML node version) More...
 
static SolverManagerPtr autoSetup (const ProblemPtr &_problem, YAML::Node _param_node, std::vector< std::string > _primary_schema_folders, bool _skip_yaml_validation=false)
 Creates a solver from a YAML node (or its 'solver' key), validated against the schemas unless skipped. More...
 

Detailed Description

Gauss-Newton solver using sparse linear solvers through Eigen (no ceres dependency)

At each iteration, all factors are linearized at the current estimate building the stacked (sparse) Jacobian A and the residual vector b. Each factor fills a block row and each non-fixed state block a block column (of the size of its tangent space). The columns are ordered with a fill-reducing ordering (COLAMD on the block structure) and the rows are sorted by their leftmost column. Factors whose state blocks are all fixed only contribute to the cost. The increment is computed solving A·dx = -b:

  • 'cholesky': Cholesky factorization of the normal equations AᵀA·dx = -Aᵀb (default, fastest).
  • 'qr': QR factorization of A (numerically more robust: cond(A) instead of cond(A)²). If SuiteSparse was found at build time, CHOLMOD (supernodal Cholesky) and SPQR (multifrontal QR) are used. Otherwise, Eigen's built-in Eigen::SimplicialLDLT and Eigen::SparseQR (much slower for large problems). If the cost increases, the step is halved until it decreases (backtracking line search, up to 10 times). As SolverCeres, with 'interrupt_on_problem_change' the solver stops (after 'min_num_iterations') as soon as the problem changes, keeping the estimate if the cost decreased (otherwise, the estimate is not updated). The problem has to be fully constrained (e.g. first frame fixed or with a prior), otherwise A is rank deficient and the solver fails.

Factors with 'apply_loss_function' use a Cauchy loss with scale 0.5 (as SolverCeres), applied by reweighting (iteratively reweighted least squares). Covariances are computed without loss function (as SolverCeres) and stored in the tangent space of the state blocks.

Member Enumeration Documentation

◆ LinearSolverType

Linear solver type.

Enumerator
QR 

QR factorization of the jacobian.

CHOLESKY 

Cholesky factorization of the normal equations.

Constructor & Destructor Documentation

◆ SolverEigen()

wolf::SolverEigen::SolverEigen ( const ProblemPtr &  _wolf_problem,
const YAML::Node &  _params 
)

Constructor from the problem and the YAML parameters.

◆ ~SolverEigen()

wolf::SolverEigen::~SolverEigen ( )
override

Member Function Documentation

◆ addFactorDerived()

void wolf::SolverEigen::addFactorDerived ( const FactorBasePtr &  fac_ptr)
overrideprotectedvirtual

Adds a factor to the derived solver.

Implements wolf::SolverManager.

◆ addStateBlockDerived()

void wolf::SolverEigen::addStateBlockDerived ( const StateBlockPtr &  state_ptr)
overrideprotectedvirtual

Adds a state block to the derived solver.

Implements wolf::SolverManager.

◆ applyIncrement()

void wolf::SolverEigen::applyIncrement ( const Eigen::VectorXd &  _dx)
protected

Applies an increment (in the tangent space) to the non-fixed state blocks.

◆ briefReport()

std::string wolf::SolverEigen::briefReport ( ) const

One line report of the last solve (as ceres::Solver::Summary::BriefReport())

◆ checkDerived()

bool wolf::SolverEigen::checkDerived ( std::string  prefix = "") const
overrideprotectedvirtual

Checks the consistency of the derived solver.

Implements wolf::SolverManager.

◆ computeCovarianceBlocks()

bool wolf::SolverEigen::computeCovarianceBlocks ( const std::vector< std::pair< StateBlockPtr, StateBlockPtr > > &  _pairs)
protected

Computes and stores in the problem the covariance blocks of the given pairs of state blocks.

◆ computeCovariancesDerived() [1/2]

bool wolf::SolverEigen::computeCovariancesDerived ( const CovarianceBlocksToBeComputed  blocks)
overridevirtual

Computes the covariances of the specified blocks in the derived solver.

Implements wolf::SolverManager.

◆ computeCovariancesDerived() [2/2]

bool wolf::SolverEigen::computeCovariancesDerived ( const std::vector< StateBlockPtr > &  st_list)
overridevirtual

Computes the covariances of a list of state blocks in the derived solver.

Implements wolf::SolverManager.

◆ converged()

bool wolf::SolverEigen::converged ( ) const
overridevirtual

Returns whether the last solve converged.

Implements wolf::SolverManager.

◆ factorize()

bool wolf::SolverEigen::factorize ( )
protected

Factorizes A_ with the selected linear solver. Returns false if it failed or A_ is rank deficient.

◆ failed()

bool wolf::SolverEigen::failed ( ) const
overridevirtual

Returns whether the last solve failed.

Implements wolf::SolverManager.

◆ finalCost()

double wolf::SolverEigen::finalCost ( ) const
overridevirtual

Returns the final cost of the last solve.

Implements wolf::SolverManager.

◆ fullReport()

std::string wolf::SolverEigen::fullReport ( ) const

Full report of the last solve (as ceres::Solver::Summary::FullReport())

◆ getJacobian()

const Eigen::SparseMatrix< double > & wolf::SolverEigen::getJacobian ( ) const
inline

Stacked jacobian of the last linearization (with loss function weights)

◆ getLinearSolverName()

std::string wolf::SolverEigen::getLinearSolverName ( ) const

Linear solver and its implementation, e.g. "cholesky (CHOLMOD)" or "qr (Eigen SparseQR)".

◆ getLinearSolverType()

SolverEigen::LinearSolverType wolf::SolverEigen::getLinearSolverType ( ) const
inline

Returns the linear solver type.

◆ hasLocalParametrizationDerived()

bool wolf::SolverEigen::hasLocalParametrizationDerived ( const StateBlockPtr &  st) const
overrideprotectedvirtual

Returns whether a state block has a local parametrization in the derived solver.

Implements wolf::SolverManager.

◆ hasThisLocalParametrizationDerived()

bool wolf::SolverEigen::hasThisLocalParametrizationDerived ( const StateBlockPtr &  st,
const LocalParametrizationBasePtr &  local_param 
) const
overrideprotectedvirtual

Returns whether a state block has a given local parametrization in the derived solver.

Implements wolf::SolverManager.

◆ initialCost()

double wolf::SolverEigen::initialCost ( ) const
overridevirtual

Returns the initial cost of the last solve.

Implements wolf::SolverManager.

◆ isFactorRegisteredDerived()

bool wolf::SolverEigen::isFactorRegisteredDerived ( const FactorBasePtr &  fac_ptr) const
overrideprotectedvirtual

Returns whether a factor is in the derived solver.

Implements wolf::SolverManager.

◆ isStateBlockFixedDerived()

bool wolf::SolverEigen::isStateBlockFixedDerived ( const StateBlockPtr &  st) const
overrideprotectedvirtual

Returns whether a state block is fixed in the derived solver.

Implements wolf::SolverManager.

◆ isStateBlockRegisteredDerived()

bool wolf::SolverEigen::isStateBlockRegisteredDerived ( const StateBlockPtr &  state_ptr) const
overrideprotectedvirtual

Returns whether a state block is in the derived solver.

Implements wolf::SolverManager.

◆ iterations()

unsigned int wolf::SolverEigen::iterations ( ) const
overridevirtual

Returns the number of iterations of the last solve.

Implements wolf::SolverManager.

◆ linearize()

bool wolf::SolverEigen::linearize ( bool  _apply_loss)
protected

Evaluates all factors at the current estimate and builds A_, b_ and cost_. Returns false if any evaluation failed.

◆ numFactorsDerived()

int wolf::SolverEigen::numFactorsDerived ( ) const
overridevirtual

Returns the number of factors in the derived solver.

Implements wolf::SolverManager.

◆ numStateBlocksEstimatedDerived()

int wolf::SolverEigen::numStateBlocksEstimatedDerived ( ) const
overridevirtual

Returns the number of estimated state blocks in the derived solver.

Implements wolf::SolverManager.

◆ printProfilingDerived()

void wolf::SolverEigen::printProfilingDerived ( std::ostream &  stream) const
overrideprotectedvirtual

Prints the profiling of the derived solver.

Implements wolf::SolverManager.

◆ reindex()

void wolf::SolverEigen::reindex ( )
protected

Recomputes the column of each non-fixed state block and the row of each factor (if structure changed)

◆ removeFactorDerived()

void wolf::SolverEigen::removeFactorDerived ( const FactorBasePtr &  fac_ptr)
overrideprotectedvirtual

Removes a factor from the derived solver.

Implements wolf::SolverManager.

◆ removeStateBlockDerived()

void wolf::SolverEigen::removeStateBlockDerived ( const StateBlockPtr &  state_ptr)
overrideprotectedvirtual

Removes a state block from the derived solver.

Implements wolf::SolverManager.

◆ sizeFactorsDerived()

int wolf::SolverEigen::sizeFactorsDerived ( ) const
overridevirtual

Returns the total residual size of the factors in the derived solver.

Implements wolf::SolverManager.

◆ sizeStateBlocksEstimatedDerived()

int wolf::SolverEigen::sizeStateBlocksEstimatedDerived ( ) const
overridevirtual

Returns the total size of the estimated state blocks in the derived solver.

Implements wolf::SolverManager.

◆ solveDerived()

std::string wolf::SolverEigen::solveDerived ( const ReportVerbosity  report_level)
overrideprotectedvirtual

Solves the problem in the derived solver, returning the report.

Implements wolf::SolverManager.

◆ solveIncrement()

Eigen::VectorXd wolf::SolverEigen::solveIncrement ( ) const
protected

Solves A_·dx = -b_ using the last factorization.

◆ solveNormalEquations()

Eigen::MatrixXd wolf::SolverEigen::solveNormalEquations ( const Eigen::MatrixXd &  _E) const
protected

Solves (AᵀA)·X = E using the last factorization.

◆ terminationType()

std::string wolf::SolverEigen::terminationType ( ) const

Termination type of the last solve, with the ceres names: CONVERGENCE, NO_CONVERGENCE, FAILURE, USER_SUCCESS (interrupted, cost decreased) or USER_FAILURE (interrupted, estimate not updated)

◆ totalTime()

double wolf::SolverEigen::totalTime ( ) const
overridevirtual

Returns the total time of the last solve.

Implements wolf::SolverManager.

◆ updateStateBlockLocalParametrizationDerived()

void wolf::SolverEigen::updateStateBlockLocalParametrizationDerived ( const StateBlockPtr &  state_ptr)
overrideprotectedvirtual

Updates the local parametrization of a state block in the derived solver.

Implements wolf::SolverManager.

◆ updateStateBlockStatusDerived()

void wolf::SolverEigen::updateStateBlockStatusDerived ( const StateBlockPtr &  state_ptr)
overrideprotectedvirtual

Updates the fixed/unfixed status of a state block in the derived solver.

Implements wolf::SolverManager.

◆ wasStopped()

bool wolf::SolverEigen::wasStopped ( ) const
overridevirtual

Returns whether the last solve was stopped (interrupted by a problem change)

Implements wolf::SolverManager.

◆ WOLF_SOLVER_CREATE()

wolf::SolverEigen::WOLF_SOLVER_CREATE ( SolverEigen  )

Member Data Documentation

◆ A_

Eigen::SparseMatrix<double> wolf::SolverEigen::A_
protected

Stacked jacobian (weighted by the loss function if applicable)

◆ analysis_dirty_

bool wolf::SolverEigen::analysis_dirty_
protected

The structure changed: symbolic analysis of the factorization needed.

◆ b_

Eigen::VectorXd wolf::SolverEigen::b_
protected

Stacked residuals (weighted by the loss function if applicable)

◆ converged_

bool wolf::SolverEigen::converged_
protected

Terminated by convergence.

◆ cost_

double wolf::SolverEigen::cost_
protected

Cost at the current estimate.

◆ fac_2_row_

std::map<FactorBasePtr, unsigned int> wolf::SolverEigen::fac_2_row_
protected

First row of each factor.

◆ failed_

bool wolf::SolverEigen::failed_
protected

Terminated by failure.

◆ final_cost_

double wolf::SolverEigen::final_cost_
protected

Cost after the solve.

◆ fixed_state_blocks_

std::set<StateBlockPtr> wolf::SolverEigen::fixed_state_blocks_
protected

Registered fixed state blocks.

◆ function_tolerance_

double wolf::SolverEigen::function_tolerance_
protected

Convergence tolerance on the cost change.

◆ gradient_tolerance_

double wolf::SolverEigen::gradient_tolerance_
protected

Convergence tolerance on the gradient.

◆ initial_cost_

double wolf::SolverEigen::initial_cost_
protected

Cost before the solve.

◆ interrupt_on_problem_change_

bool wolf::SolverEigen::interrupt_on_problem_change_
protected

Interrupt the solver if the problem changed (as SolverCeres)

◆ iterations_

unsigned int wolf::SolverEigen::iterations_
protected

Number of iterations.

◆ ldlt_

Eigen::SimplicialLDLT<Eigen::SparseMatrix<double> > wolf::SolverEigen::ldlt_
protected

Eigen's Cholesky (LDLT) of the normal equations.

◆ line_search_steps_

unsigned int wolf::SolverEigen::line_search_steps_
protected

Step halvings of the backtracking line search.

◆ linear_solver_

LinearSolverType wolf::SolverEigen::linear_solver_
protected

Linear solver type.

◆ linear_solver_time_

double wolf::SolverEigen::linear_solver_time_
protected

Time spent in linear solves.

◆ linearization_time_

double wolf::SolverEigen::linearization_time_
protected

Time spent linearizing.

◆ max_num_iterations_

unsigned int wolf::SolverEigen::max_num_iterations_
protected

Maximum number of iterations.

◆ min_num_iterations_

unsigned int wolf::SolverEigen::min_num_iterations_
protected

Iterations during which the solver cannot be interrupted.

◆ minimizer_time_

double wolf::SolverEigen::minimizer_time_
protected

Time of the minimization stage.

◆ n_cols_

unsigned int wolf::SolverEigen::n_cols_
protected

Columns of the stacked jacobian.

◆ n_convergence_

unsigned int wolf::SolverEigen::n_convergence_
protected

Solves terminated by convergence.

◆ n_failed_

unsigned int wolf::SolverEigen::n_failed_
protected

Solves terminated by failure.

◆ n_interrupted_

unsigned int wolf::SolverEigen::n_interrupted_
protected

Solves terminated by interruption.

◆ n_iter_acc_

unsigned int wolf::SolverEigen::n_iter_acc_
protected

Accumulated iterations of all solves.

◆ n_iter_max_

unsigned int wolf::SolverEigen::n_iter_max_
protected

Maximum iterations of a single solve.

◆ n_linear_solves_

unsigned int wolf::SolverEigen::n_linear_solves_
protected

Number of linear solves.

◆ n_linearizations_

unsigned int wolf::SolverEigen::n_linearizations_
protected

Number of linearizations.

◆ n_no_convergence_

unsigned int wolf::SolverEigen::n_no_convergence_
protected

Solves terminated without convergence.

◆ n_rows_

unsigned int wolf::SolverEigen::n_rows_
protected

Rows of the stacked jacobian.

◆ parameter_tolerance_

double wolf::SolverEigen::parameter_tolerance_
protected

Convergence tolerance on the step size.

◆ postprocessor_time_

double wolf::SolverEigen::postprocessor_time_
protected

Time of the postprocessing stage.

◆ preprocessor_time_

double wolf::SolverEigen::preprocessor_time_
protected

Time of the preprocessing stage.

◆ qr_

Eigen::SparseQR<Eigen::SparseMatrix<double>, Eigen::NaturalOrdering<int> > wolf::SolverEigen::qr_
protected

Columns ordered in reindex()

◆ R_

Eigen::SparseMatrix<double> wolf::SolverEigen::R_
protected

(sorted) R factor of the QR, used for covariances

◆ R_perm_

Eigen::PermutationMatrix<Eigen::Dynamic, Eigen::Dynamic, int> wolf::SolverEigen::R_perm_
protected

Column permutation of the QR.

◆ Rt_

Eigen::SparseMatrix<double> wolf::SolverEigen::Rt_
protected

Transpose of R_.

◆ sb_2_col_

std::map<StateBlockPtr, unsigned int> wolf::SolverEigen::sb_2_col_
protected

First column of each non-fixed state block.

◆ sb_2_local_param_

std::map<StateBlockPtr, LocalParametrizationBasePtr> wolf::SolverEigen::sb_2_local_param_
protected

Local param of each state block.

◆ stopped_

bool wolf::SolverEigen::stopped_
protected

Terminated by interruption.

◆ structure_dirty_

bool wolf::SolverEigen::structure_dirty_
protected

The structure changed: reindexing needed.

◆ successful_steps_

unsigned int wolf::SolverEigen::successful_steps_
protected

Accepted Gauss-Newton steps.

◆ suitesparse_

std::unique_ptr<SuiteSparseSolvers> wolf::SolverEigen::suitesparse_
protected

SPQR and CHOLMOD (defined only if SuiteSparse was found)

nullptr if SuiteSparse was not found

◆ termination_message_

std::string wolf::SolverEigen::termination_message_
protected

Termination message.

◆ total_time_

double wolf::SolverEigen::total_time_
protected

Total time of the solve.

◆ unsuccessful_steps_

unsigned int wolf::SolverEigen::unsuccessful_steps_
protected

Rejected Gauss-Newton steps.


The documentation for this class was generated from the following files: